package io.codegeneratetool.util.validate;

import java.lang.reflect.Field;
import java.util.Map;

import javax.validation.constraints.Max;

public class MaxProcessor extends BaseProcessorChain<Max> {

	public <T> void process(T t, Field field,
			Map<String, Object> validateContainer, Map<String, Object> messages) {
		Max annotation = field.getAnnotation(Max.class);
		long max = annotation.value();
		validateContainer.put("max", max);
		messages.put("maxlength", getMessage(annotation.message(),"最大长度 "+ max));

	}

}
